<?php

class cacheController extends controllerBase {
	protected $mode = AETHER_CLI;
	protected $view = false;
	protected $helpers = array();
	protected $models = array();
	protected $beforeFilters = array();
	protected $beforeAfter = array();
	
	function clear() {
		echo 'Clearing cache... ';
		$dir = 'app/cache';
		$dh = opendir($dir);
		while(false !== ($file = readdir($dh))) {
			if($file == '.' || $file=='..' || $file=='empty' || $file=='cacheId') {
				continue;
			}
			unlink($dir.'/'.$file);
		}
		$fn = 'app/cache/cacheId';
		file_put_contents($fn, file_get_contents($fn)+1);
		echo 'Done.';
	}
}

?>
